import request from '@/utils/request'

/**
 * @description: 初始化表结构信息和触发器
 * @return {*}
 */
export function infoSupplierDelivery() {
  return request({
    url: '/delivery/supplier/info',
    method: 'get'
  })
}

/**
 * @description: 获取供应商送货平台的产品列表
 * @param {*} params
 * @return {*}
 */
export function getDeliverySupplierGoodList(params) {
  return request({
    url: '/delivery/supplier/good/list',
    method: 'get',
    params
  })
}

/**
 * @description: 获取供应商送货单据列表
 * @param {*} params
 * @return {*}
 */
export function getDeliveryOrderList(params) {
  return request({
    url: '/delivery/supplier/order/list',
    method: 'get',
    params
  })
}

/**
 * @description: 保存供应商送货单
 * @param {*} data
 * @return {*}
 */
export function addSupplierDeliveryOrder(data) {
  return request({
    url: '/delivery/supplier/order/add',
    method: 'post',
    data
  })
}

/**
 * @description: 获取供应商送货单详情
 * @param {*} params
 * @return {*}
 */
export function getSupplierDeliveryOrder(params) {
  return request({
    url: '/delivery/supplier/order/detail',
    method: 'get',
    params
  })
}

/**
 * @description: 更新供应商送货单
 * @param {*} data
 * @return {*}
 */
export function updateSupplierDeliveryOrder(data) {
  return request({
    url: '/delivery/supplier/order/update',
    method: 'post',
    data
  })
}

/**
 * @description: 审核供应商送货单
 * @param {*} data
 * @return {*}
 */
export function examineSupplierDeliveryOrder(data) {
  return request({
    url: '/delivery/supplier/order/examine',
    method: 'post',
    data
  })
}

/**
 * @description: 删除送货申请单
 * @param {*} data
 * @return {*}
 */
export function deleteSupplierDeliveryOrder(data) {
  return request({
    url: '/delivery/supplier/order/delete',
    method: 'post',
    data
  })
}
